<?
class Bill{
    public static function getAdminActiveBill($bil_id){
        $db_query = new db_query('SELECT adm_loginname,log_time
                                    FROM log_bill_success
                                    LEFT JOIN admin_users ON adm_id = log_admin_id
                                    WHERE log_bill_id = '.$bil_id.' AND log_bill_status = '.BILL_STATUS_SUCCESS.'
                                    ORDER BY log_time DESC
                                    LIMIT 1');
        $row = mysql_fetch_assoc($db_query->result);unset($db_query);
        return $row;
    }
    public static function getAdminCancelBill($bil_id){
        $db_query = new db_query('SELECT adm_loginname,log_time
                                    FROM log_bill_success
                                    LEFT JOIN admin_users ON adm_id = log_admin_id
                                    WHERE log_bill_id = '.$bil_id.' AND log_bill_status = '.BILL_STATUS_CANCEL.'
                                    ORDER BY log_time DESC
                                    LIMIT 1');
        $row = mysql_fetch_assoc($db_query->result);unset($db_query);
        return $row;
    }
}
?>